package com.qfjy.service.impl;

import com.qfjy.mq.QueueTask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

/**
 * @ClassName EmailServiceImpl
 * @Description TODO 邮件业务逻辑
 * @Author guoweixin
 * @Date 2022/4/1
 * @Version 1.0
 */
@Service
@Slf4j
public class EmailServiceImpl {

    @Value("${server.port}")
    private  String port;

    /**
     * 监听MQ上是否有消息队列产生（消费者）
     * queues 队列名称
     * @param cardId
     */
    @RabbitListener(queues = {QueueTask.QUEUE_NAME_EMAIL})
    public void sendEmail(String cardId){

        log.info("邮件发送成功--向帐户--》"+cardId+"-->"+port);

    }
}
